package com.example.qxfw.qxzs.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.qxfw.common.entity.qx.SpecialSrvStation;
import com.example.qxfw.qxzs.mapper.SpecialSrvStationMapper;
import com.example.qxfw.qxzs.service.SpecialSrvStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SpecialSrvStationServiceImpl implements SpecialSrvStationService {

    @Autowired
    private SpecialSrvStationMapper specialSrvStationMapper;

    @Override
    public List<SpecialSrvStation> getList() {
        List<SpecialSrvStation> specialSrvStations = specialSrvStationMapper.selectList1();
        return specialSrvStations;
    }

    @Override
    public List<SpecialSrvStation> getListByName(String stationName) {

        return specialSrvStationMapper.selectList(Wrappers.<SpecialSrvStation>query()
                .select("distinct Stationid, Longitude, Latitude ")
                .lambda()
                .eq(SpecialSrvStation::getStationname,stationName)
                .like(SpecialSrvStation::getFlag,"%指数%"));
    }

    @Override
    public List<String> getStationName() {
        List<String> stationName = specialSrvStationMapper.selectStationName();
        return stationName;
    }

    @Override
    public List<String> getStationFlag() {
        List<String> flag = specialSrvStationMapper.selectStationFlag();
        return flag;
    }

    @Override
    public List<SpecialSrvStation> getList2(String flag) {
        List<SpecialSrvStation> specialSrvStations = specialSrvStationMapper.selectList2(flag);
        return specialSrvStations;
    }

    @Override
    public List<String> getStationIdByName(String stationName) {
        List<String> stationId = specialSrvStationMapper.selectStationIdByName(stationName);
        return stationId;
    }

    @Override
    public List<SpecialSrvStation> getList3(String city) {
        return specialSrvStationMapper.selectList3(city);
    }

    @Override
    public List<SpecialSrvStation> getList4(String stationId) {
        return specialSrvStationMapper.selectList4(stationId);
    }

    @Override
    public List<SpecialSrvStation> getList5(String stationId, String flag, String city) {
        return specialSrvStationMapper.selectList5(stationId, flag, city);
    }
}
